from datetime import date
from datetime import datetime
import requests

text = "2017-01"
print datetime.strptime(text, '%Y-%m')

print datetime.now()
print datetime.now().strftime('%Y-%m')

ip = "http://47.52.58.220:10800"
ip_2 = "http://127.0.0.1:10800"

def test_set_next_color(t=0):
    if t:
        url = ip + "/wxhh/set_next_color"
    else:
        url = ip_2 + "/wxhh/set_next_color"
    params = {"next_color": 4}
    r = requests.post(url, params)
    print r.text


def test_add_gold_for_user(t=0):
    if t:
        url = ip + "/wxhh/add_gold_for_user"
    else:
        url = ip_2 + "/wxhh/add_gold_for_user"
    params = {"tel": 1212, "gold": 10}
    r = requests.post(url, params)
    print r.text

def test_get_all_player_list():
    url = "http://192.168.1.68:5000/wxhh/get_all_player_list"
    r = requests.get(url)
    print r.text

def test_get_away_pool_info():
    url = "http://127.0.0.1:10800/wxhh/get_away_pool_info"
    r = requests.get(url)
    print r.text
test_add_gold_for_user(t=1)